/*
 *  $Id: FireWard.cs 1055 2010-05-19 12:02:44Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008-2009 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Fire.Spells {
    public class FireWard: SelfEnchantmentCard {
        public FireWard() : base("001_f_s_fire_ward") {
            Level = CompleteLevel.ReadyForTest;
            Version = 0;
            Element = ElementType.Fire;
            AdditionalElement = ElementType.Air;
            Value = 100;
            Category = CardCategory.Ward;
            AddManaCost(Element, 2);
            AddManaCost(AdditionalElement, 2);
            AddCondition(new MeditationCondition(2, true));
        }

        protected override EnchantmentAffect CreateEnchantment() {
            return new FireWardAffect();
        }

        private static readonly Languages.CardPhrase<FireWard> EndMessage = new Languages.CardPhrase<FireWard>("end");

        private class FireWardAffect : EnchantmentAffect<FireWard> {
            public FireWardAffect() {
                Add(new Affects.WardMana(CardType.Spell));
            }

            public override void ResetAffect() {
                base.ResetAffect();
                if (IsEnded)
                    Owner.Owner.Game.Log.Add(EndMessage.Phrase);
            }
        }
    }
}
